package mapper;

import cn.sxjzit.officlal.config.SpringConfig;
import cn.sxjzit.officlal.entity.*;
import cn.sxjzit.officlal.mapper.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = SpringConfig.class)
@WebAppConfiguration("src/main/resources")
public class test {

    @Autowired
    public BannerMapper bannerMapper;
    @Test
    public void delete(){
        System.out.println("bannerMapper = " + bannerMapper);

        bannerMapper.deleteBanner(1);

        System.out.println("Test2.delete");
    }

    @Test
    public void select(){
        List<Banner> banner = bannerMapper.selectAllBanner();
        System.out.println("banner = " + banner);

    }
    @Autowired
    public CompanyMapper companyMapper;
    @Test
    public void selectCompany(){
        List<Company> companies = companyMapper.selectAllCompany();
        System.out.println("companies = " + companies);
    }
    @Autowired
    public CourseMapper courseMapper;
    @Test
    public void selectCourse(){
        List<Course> courses = courseMapper.selectAllCourse();
        System.out.println("courses = " + courses);
    }
    @Test
    public void selectFineCourse(){
        List<FineCourse> fineCourses = courseMapper.selectAllFineCourse();
        System.out.println("fineCourses = " + fineCourses);
    }
    @Test
    public void selectDetailCourse(){
        List<CourseDetail> courseDetails = courseMapper.selectAllCourseDetail();
        System.out.println("courseDetails = " + courseDetails);

    }
    @Autowired
    NavMapper navMapper;
    @Test
    public void selectNav(){
        List<Nav> navs = navMapper.selectAllNav();
        System.out.println("navs = " + navs);
    }
    @Autowired
    TeacherMapper teacherMapper;
    @Test
    public void selectTeacher(){
        List<Teacher> teachers = teacherMapper.selectAllTeacher();
        System.out.println("teachers = " + teachers);


    }
    @Autowired
    TServiceMapper tServiceMapper;
    @Test
    public void selectTService(){
        List<TService> list = tServiceMapper.selectAllTService();
        System.out.println("list = " + list);
    }
    @Autowired
    UserMapper userMapper;
    @Test
    public void selectUser(){
        List<User> users = userMapper.selectAllUser();
        System.out.println("users = " + users);
    }






}
